import 'package:flutter/material.dart';
import './rxDart_demo.dart';

class RxDartListDemo extends StatelessWidget {
  const RxDartListDemo({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("RxDartListDemo"),
        elevation: 0.0,
      ),
      body: ListView(
        children: <Widget>[
          itemBuilder('RxDart', RxDartDemo())
        ],
      ),
    );
  }
}

class itemBuilder extends StatelessWidget {
  final String title;
  final Widget page;

  itemBuilder(
    this.title,
    this.page
  );

  @override
  Widget build(BuildContext context) {
    return ListTile(
      title: Text('$title'),
      onTap: (){
        Navigator.of(context).push(
          MaterialPageRoute(builder: (context)=>page)
        );
      },
    );
  }
}